<template>
  <dt-modal-info ref="info" title="使用记录" :label-width="180" :width="1000">
    <div v-if="logList.length">
      <div class="useBox" v-for="(item, index) in logList" :key="index">
        <p>
          <span>使用顾问：{{ item.userName || '-' }}</span>
          <span>使用时间：{{ item.startDate }}-{{ item.endDate }}</span>
          <span>
            案场：{{ item.housesName || '-' }}（{{ item.caseLocationTwo || '-' }}）— {{ item.city || '-' }}
          </span>
        </p>
        <p>
          <span>使用类型：{{ item.callType || '-' }}</span>
          <span>使用业务方：{{ item.businessSource || '-' }}</span>
          <span>运营配置人：{{ item.createName || '-' }}</span>
        </p>
        <p>
          <span>投放渠道：{{ item.deliveryChannel || '-' }}</span>
        </p>
      </div>
    </div>
    <div v-else class="wu">暂无记录</div>
  </dt-modal-info>
</template>

<script>
  import receiverMgr from '@/biz/receiver/receiver'
  export default {
    data() {
      return {
        logList: []
      }
    },
    methods: {
      show(privacy) {
        let params = {
          privacy: privacy
        }
        receiverMgr.useLogList(params).then((res) => {
          this.logList = res
        })

        this.$refs.info.show()
      }
    }
  }
</script>

<style lang="scss" scoped>
  .useBox {
    margin-top: 15px;

    p {
      display: flex;
      flex-direction: row;
      justify-content: space-between;

      span {
        width: 33.33%;
        line-height: 1.8;
      }
    }
  }

  .wu {
    min-height: 300px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
</style>
